package cn.ainit.sys.config;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.ainit.sys.dz.entity.SysDzSource;

@Transactional
@Repository("sysConfigDao")
public class SysConfigDaoImpl implements SysConfigDao{
	private JdbcTemplate jdbcTemplate;
	
	@Resource
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	
	
	public SessionFactory sessionFactory;
	@Resource
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	
	
	
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}
	@Override
	public List<SysDzSource> loadAddDzSource() throws Exception {
		return this.sessionFactory.getCurrentSession().createQuery("from SysDzSource").list();
	}
	
	
}





